#include "junix.h"
using namespace std;

struct G
{
	int v;
	G(int n):v(n){}
	int operator()()
	{
		return v++;
	}
};

int main(int argc, char **argv)
{
	vector<int> vi(20),vi2;
	generate(vi.begin(), vi.end(),G(2));

	vi2.push_back(3);
	vi2.push_back(13);
	vi2.push_back(11);
	vi2.push_back(19);

	vector<int>::iterator pos;
	pos=find_first_of( vi.begin(),vi.end(),
			vi2.begin(),vi2.end());
	cout<<*pos<<endl;

	pos=find_first_of( vi.begin(),vi.end(),
			vi2.begin(),vi2.end(),
			greater<int>());
	cout<<*pos<<endl;

	pos=find_first_of( vi.begin(),vi.end(),
			vi2.begin(),vi2.end(),
			greater_equal<int>());
	cout<<*pos<<endl;

}
